package com.company.cloud.club.modules.core.dto.project;

import com.company.cloud.club.modules.core.util.ValidateUtil;
import com.company.cloud.club.modules.db.domain.ProjectCase;
import com.company.cloud.club.modules.db.domain.ProjectCaseBrand;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode
public class CaseDto implements Serializable {

    private String id;

    private String title;

    private List<ProjectCaseBrand> children = new ArrayList<>();

    public void addCaseBrand(ProjectCaseBrand dto) {
        if (ValidateUtil.isValid(dto)) {
            this.children.add(dto);
        }
    }

}
